package com.nc.delivery_project.client.add_user;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.*;

/**
 * Created by miroshnik on 1/10/2015.
 */
public class AddUserView extends Composite {
    interface AddUserViewUiBinder extends UiBinder<VerticalPanel, AddUserView> {
    }

    private static AddUserViewUiBinder ourUiBinder = GWT.create(AddUserViewUiBinder.class);
    
    AddUserPresenter presenter;

    @UiField
    TextBox emailTxtBox;

    @UiField
    TextBox passTxtBox;

    @UiField
    ListBox roleLstBox;

    @UiField
    Button regBtn;
    
    public AddUserView() {
        initWidget(ourUiBinder.createAndBindUi(this));
    }
    
    @UiHandler("regBtn")
    void registrationHandler(ClickEvent event) {
        presenter.registration();
    }

    public void setPresenter(AddUserPresenter presenter) {
        this.presenter = presenter;
    }
}